package com.alianzamedica.connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import org.objectsearch.connection.ConnectionInterface;

/**
 * @author Carlos
 * 
 */
public class ConnectionTest implements ConnectionInterface {

	private Connection connection;

	@Override
	public void close() throws SQLException {
		if (this.connection != null) {
			this.connection.close();
		}

	}

	@Override
	public Connection getConnection() {
		return connection;
	}

	@Override
	public void open() throws Exception {
		Class.forName("com.mysql.jdbc.Driver").newInstance();
		String url = "jdbc:mysql://localhost/alianza";
		this.connection = DriverManager.getConnection(url, "root", "");
	}

}
